//////////////////////////////////////////////////////
// Constants.h
//////////////////////////////////////////////////////

#pragma once
const MaxMonsters = 14;
const MAPSECTORCOUNT = 1764;
const MAXPEOPLE = 100;
const MAXCONTAINERS = 100;
const MAXDOORS = 100;
const TILESIZE = 100;
const XOFFSET = 0; //16;
const YOFFSET = 0; //30;
const NORMALVISIBLEPLAYERCOL = 4;//5;
const NORMALVISIBLEPLAYERROW = 12;
const VISIBLECOLUMNCOUNT = 8;
const VISIBLEROWCOUNT = 23;
const MAPCOLUMNCOUNT = 42;
const MAPROWCOUNT = 42;
const NUM_SPRITES = 100;
const COLUMNSINTILEFILE = 10;

// Impassable Objects in the town exterior.
const BRICKWALL_EXT = 6;
const VERTFENCE_EXT = 16;
const HORZFENCE_EXT = 17;
const ANGLEFENCE_EXT = 18;
const TREE_EXT = 3;
const FOUNTAIN_EXT = 50;
const WELL_EXT = 29;
const STONEWALL_EXT = 30;
const WINDOW1_EXT = 8;
const WINDOW2_EXT = 9;
const WATER01_EXT = 32;
const WATER02_EXT = 49;

// Fast animation objects in the town exterior.
const RIGHTTORCH = 54;
const LEFTTORCH = 56;

// Fastest animation objects in the town exterior.
const STREETLIGHT_EXT = 52;

// Misc. tile IDs for town exterior.
const DOOR_EXT = 15;

// Impassable Objects in the town interior.
const BRICKWALL_INT = 1;
const WINDOW1_INT = 2;
const WINDOW2_INT = 3;
const CUPBOARD_INT = 6;
const TABLE01_INT = 13;
const TABLE02_INT = 14;
const TABLE03_INT = 15;
const BED01_INT = 24;
const BED02_INT = 25;
const BED03_INT = 26;
const BED04_INT = 27;
const FIREPLACE_INT = 38;
const MANINCHAIR01_INT = 44;
const MANINCHAIR02_INT = 46;
const MANINCHAIR03_INT = 48;
const MANINCHAIR04_INT = 50;
const MANINBED01_INT = 52;
const MANINBED02_INT = 54;

// Fast animation objects in the town interior.
const STAIRSUP_INT = 40;
const STAIRSDOWN_INT = 42;



// Fastest animation objects in the town interior.
const BRASIER_INT = 34;
const STOVE_INT = 36;

// Misc. tile IDs for town interior.
const DOOR_INT = 4;
const CHEST_INT = 18;
const BARREL_INT = 19;
const FOOTLOCKER_INT = 30;

// Impassable Objects in the dungeon.
const BRICKWALL_DUN = 1;
const WINDOW1_DUN = 2;
const WINDOW2_DUN = 3;
const CUPBOARD_DUN = 6;
const TABLE01_DUN = 12;
const TABLE02_DUN = 13;
const TABLE03_DUN = 14;
const BED01_DUN = 24;
const BED02_DUN = 25;
const BED03_DUN = 26;
const BED04_DUN = 27;
const WATER_DUN = 32;
const FIREPLACE_DUN = 38;
const MANINCHAIR01_DUN = 44;
const MANINCHAIR02_DUN = 46;
const MANINCHAIR03_DUN = 48;
const MANINCHAIR04_DUN = 50;
const MANINBED01_DUN = 52;
const MANINBED02_DUN = 54;

// Misc. tile IDs for dungeon.
const DOOR_DUN = 4;
const CHEST_DUN = 18;
const BARREL_DUN = 19;
const FOOTLOCKER_DUN = 30;

// Impassable objects in the Wilderness.
const MOUNTAIN01_WLD = 8;
const MOUNTAIN02_WLD = 9;
const MOUNTAIN03_WLD = 10;
const MOUNTAIN04_WLD = 11;
const CASTLE01_WLD = 16;
const CASTLE02_WLD = 17;
const CASTLE03_WLD = 18;
const CASTLE04_WLD = 19;
const CASTLE05_WLD = 20;
const WATER_WLD = 32;

// Movement directions.
const NORTH = 0;
const SOUTH = 1;
const EAST = 2;
const WEST = 3;

// Map types.
enum g_byMapTypeEnum
{
    TOWNEXTERIOR,
    TOWNINTERIOR,
    DUNGEON,
    WILDERNESS
};

enum g_iLocationEnum
{
    TRAININGGROUNDS,
	BATTLEMAP
};

// Door statuses
const NODOOR = 0;
const DOORUNLOCKED = 1;
const DOORLOCKED = 2;

// Constants for container items.
const NOWEAPON = 0;
const NOARMOR = 0;
const NOFOOD = 0;
const NOGOLD = 0;
const NOKEYS = 0;
const NOPOTION = 0;

// NPC tile IDs.
const NPC01 = 58;
const NPC02 = 60;
const NPC03 = 62;

// Monster frame IDs.
const MONSTERIDLEFRAME1 = 0;
const MONSTERIDLEFRAME2 = 1;
const MONSTERATTACKFRAME = 2;
const MONSTERHITFRAME = 3;

const MYMONSTERDIEFRAME1 = 23;
const MYMONSTERDIEFRAME2 = 24;
const MYMONSTERDIEFRAME3 = 25;
const MYMONSTERIDLEFRAME = 20;

// Sound effect IDs
enum g_sounds
{
    PLAYERHIT,
    MONSTERHIT,
    MONSTERDIES,
    ITEMOPEN,
	TrainingGroundsMusic,
	TitleScreenMusic,
	BattleMapMusic
};

//GameState processing
enum CurrentGameState
{
	TitleScreen,
	PlayGame,
	BattleMenu,
	BattleMenuMoveOnly,
	BattleMenuAttackOnly,
	AttackCursor,
	MoveCursor,
	AttackDecide,
	MoveDecide,
	AttackCursorDone,
	MoveCursorDone,
	AttackDecideDone,
	MoveDecideDone,
	AttackRead,
	AttackReadDone,
	FacingDecide
};

//Facing values

enum Facing
{
	Right,
	Down,
	Left,
	Up
};

//MenuOptions processing
enum MenuOptions
{
	StartGame,
	Options,
	QuitGame,
	Max
};

typedef struct sWaveHeader {
  char  RiffSig[4];         // 'RIFF'
  long  WaveformChunkSize;  // 8
  char  WaveSig[4];         // 'WAVE'
  char  FormatSig[4];       // 'fmt ' (notice space after)
  long  FormatChunkSize;    // 16
  short FormatTag;          // WAVE_FORMAT_PCM
  short Channels;           // # of channels
  long  SampleRate;         // sampling rate
  long  BytesPerSec;        // bytes per second
  short BlockAlign;         // sample block alignment
  short BitsPerSample;      // bits per second
  char  DataSig[4];         // 'data'
  long  DataSize;           // size of waveform data
} sWaveHeader;